package com.example.design.ordermanagement.command;

import com.example.design.ordermanagement.command.receiver.OrderCommandReceiver;
import com.example.design.pojo.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

// 命令模式具体命令角色
@Component
public class OrderCommand implements OrderCommandInterface {
    @Resource
    private OrderCommandReceiver receiver;

    @Override
    public void execute(Order order) {
        //调用命令接收者的执行方法，执行命令
        this.receiver.action(order);
    }
}
